Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

New: Mark optional parameters (fixes #186) #187

Merged
merged 1 commit into from
Mar 18, 2017

Conversation

Pajn
Copy link
Contributor

@Pajn Pajn commented Mar 17, 2017

I choose to avoid storing optional: false to avoid a giant mess of failing tests, as undefined is false the use case still works.

@eslintbot
Copy link

LGTM

@soda0289
Copy link
Member

Are there other cases where we need this:
What about interfaces:

interface foo {
	bar?: string 
}

or classes

class foo {
    public bar?: string
}

@Pajn
Copy link
Contributor Author

Pajn commented Mar 17, 2017

We would need everything to be able to print the AST back to source. This was just what I encountered but to avoid a bunch of PRs to extend that if I can try to lookup and fix other cases. Apart from those two, properties in type object literals come to mind as well but I guess there can be even more.

@Pajn Pajn force-pushed the optional-identifiers branch from c5e3e1a to d52e2de Compare March 18, 2017 10:34
@eslintbot
Copy link

LGTM

@Pajn
Copy link
Contributor Author

Pajn commented Mar 18, 2017

I think I have gotten all cases, however the SyntaxKinds does not align perfectly with the spec so if you think of any other case to test please alert me.
Type aliases initializers goes trough the same path as type annotations so I didn't add en explicit test for those but can of course do so if you prefer.

@JamesHenry
Copy link
Member

JamesHenry commented Mar 18, 2017

I think this is good for now. I will likely refactor this a bit in a future PR to have consistency around the optional property (i.e. add the optional: false to other tests)

@JamesHenry JamesHenry merged commit 04f6556 into eslint:master Mar 18, 2017
@JamesHenry
Copy link
Member

Blast, this was out of date with master and has caused an issue with the new optional params. I will submit a fix. I thought github repo was configure to block situations like that

@JamesHenry
Copy link
Member

Purely a test output that needs updating, no functional regression

@Pajn
Copy link
Contributor Author

Pajn commented Mar 18, 2017

I can rebase the PRs on each other if you prefer. Just tell me which and in what order.

@JamesHenry
Copy link
Member

We'll just rebase each PR against master ahead of merging

@platinumazure
Copy link
Member

@JamesHenry Another possibility is re-trigger the Travis PR build before merging a PR if you had merged a few other PRs before getting to that one- Travis will run the PR against latest master.

@JamesHenry
Copy link
Member

Good point, @platinumazure! Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants